<template>
  <div class="content">
    <el-card class="box-card">
      <h1 class="title">印刷报价系统</h1>
      <el-form :model="ruleForm" status-icon ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="账号" prop="account">
          <el-input type="text" v-model="ruleForm.account" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="pwd">
          <el-input type="password" v-model="ruleForm.pwd" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="clickToLogin()">登录</el-button>
          <el-button @click="">重置</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'Login',
  data () {
    return {
      ruleForm: {
        account: 'jeffery',
        pwd: '123456'
      }
    }
  },
  methods: {
    async clickToLogin () {
      this.$router.push('/home')
      sessionStorage.setItem('roleType', '1')
      /*
      const param = {name: this.ruleForm.account, password: this.ruleForm.pwd}
      const res = await this.$http.post('/CostOfferUser/login', param)
      if (res.data.info) {
        sessionStorage.setItem('roleType', res.data.info.role)
        this.$message.success(`${res.data.info.name}, 欢迎您！`)
        this.$router.push('/home')
      } else {
        this.$message.error('账号或密码错误！')
      } */
    }
  }

}
</script>

<style scoped>
.box-card{
  width: 480px;
  height: 300px;
}

.content{
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 100px;
}

.title{
  margin: 10px 120px;
}
</style>
